package com.wangzhen.codebase.apidemo;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class FutureDemo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask futureTask = new FutureTask(() -> 1 + 2);
        Thread t1 = new Thread(futureTask);
        t1.start();
        Object o = futureTask.get();
        System.out.println(o);

    }
}
